package com.dommettj.rawfix.session;

import com.dommettj.rawfix.message.MalformedMessageException;
import com.dommettj.rawfix.message.MessageHandler;
import com.dommettj.rawfix.message.MessageType;
import com.dommettj.rawfix.settings.Settings;

import java.io.IOException;

public interface Session {

    void start() throws SessionException, IOException;
    void stop() throws SessionException;
    boolean isActive();

    String constructMessage(String messageBody) throws MalformedMessageException;
    void registerMessageHandler(MessageType messageType, MessageHandler messageHandler);
    void sendMessage(String message) throws SessionException;

    void notifySessionSettingsUpdated(Settings settings);
}
